<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <foreach name="logConf" item="conf" key="index">
            <php>$paramArr["log_index"] = $index;</php>
            <li <if condition="$logIndex == $index">class="active"</if> ><a href="{:url($action,$paramArr)}">{$conf["title"]}</a></li>
        </foreach>
    </ul>
    <form class="search_form" method="get" action="{:url($action)}">
        <div class="well form-inline margin-top-20">
            {$whereHtml}
            <input type="hidden" name="log_type" id="log_type" value="{$logType}">
            <input type="hidden" name="log_index" id="log_index" value="{$logIndex}">
            <input type="hidden" name="hide_nav" id="hide_nav" value="{:input('hide_nav')}">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$export">
                <button type="submit" class="btn btn-danger" name="export" value="1">导出</button>
            </if>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <foreach name="headHtml" item="v">
                        <th style="text-align: center">{$v}</th>
                    </foreach>
                </tr>
            </thead>
            <tbody>
            <php>
                include(APP_PATH.APP_NAME."/logs_fun.php");
                foreach($data as $vo){
                    echo '<tr>';
                    foreach($logConf[$logIndex]['show'] as $k => $v){
                        echo '<td>';
                        //回调函数
                        if(isset($v['function']) && is_callable($v['function'])){
                            $params = isset($v['param']) ? $v['param'] : ['field' => $k];
                            echo call_user_func($v['function'], $vo, $params);
                        }
                        //默认值
                        elseif(isset($v["default"])){
                            echo $v["default"];
                        }
                        //记录值
                        else {
                            echo $vo[$k];
                        }
                        echo '</td>';
                    }
                    echo '</tr>';
                }
            </php>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<include file="public@footer" />
<script type="text/javascript">
    if($(".well").find(".chosen_select").length){
        $(".well").addClass("padding-top-10");
    }
</script>